# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  include Authentication
  helper :all # include all helpers, all the time
  protect_from_forgery # See ActionController::RequestForgeryProtection for details
  
  before_filter :set_current_user_in_thread, :set_locale
  
  def set_locale
    I18n.locale = :pt
  end
  
  def current_user
    unless @current_user
      @current_user = User.find(1)
    end
    @current_user
  end
  
  def set_current_user_in_thread
    Thread.current[:user_id] = 1
  end
  
  # Scrub sensitive parameters from your log
  # filter_parameter_logging :password
end
